<?php
/**
 * Created by PhpStorm.
 * User: HUNG NGUYEN
 * Date: 1/16/14
 * Time: 1:47 PM
 */
require_once('db_config.php');
class ChonMonController {
    public function __construct()
    {

    }
    public static function suaMon()
    {

    }
    public static function xoaMon($mact,$mahang)
    {
        try
        {
            $response['success']=1;
            /* Open a connection */
            $mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
            $query_update="delete from bkchitietban where mact='$mact' and mahang='$mahang'";
            $mysqli->query($query_update);

            echo json_encode($response);
        }
        catch(Exception $e)
        {
            $response['success']=1;
            $response['errorcode']=$e->getMessage();
            echo json_encode($response);

        }

    }
    public static function themGhiChu($mact,$mahang,$ghichu)
    {
        try
        {
            $response['success']=1;
            /* Open a connection */
            $mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
            $query_update="update bkchitietban set ghichu='$ghichu' where mact='$mact' and mahang='$mahang'";
            $mysqli->query($query_update);

            echo json_encode($response);
        }
        catch(Exception $e)
        {
            $response['success']=1;
            $response['errorcode']=$e->getMessage();
            echo json_encode($response);

        }

    }
    public static function tachBuild($mact)
    {

    }
    public  static function gopBuild($mact1,$mact2)
    {

    }

} 